cmake_minimum_required(VERSION 3.8)

project(DeviceConfigTool LANGUAGES CSharp)

set(CMAKE_CSharp_COMPILER "csc")  # C# 编译器
set(CMAKE_CSharp_STANDARD 7.3)
set(CMAKE_CSharp_STANDARD_REQUIRED ON)

# Create a Windows Forms application
add_executable(DeviceConfigTool WIN32)

# Set target framework to .NET 4.7.2 (compatible with VS2019)
set_property(TARGET DeviceConfigTool PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2")
set_property(TARGET DeviceConfigTool PROPERTY VS_DOTNET_REFERENCES
    "System"
    "System.Data"
    "System.Drawing"
    "System.Windows.Forms"
    "System.Xml"
)

# Add source files (will be created next)
# 1111222# 1111222  aaaaaabbbcccedddd
target_sources(DeviceConfigTool
    PRIVATE
    MainForm.cs
    Program.cs
    UdpScanner.cs
    DeviceInfo.cs
)
